* NOTE: You need to set the Stata working directory to the path
* where the data file is located.

set more off

clear
quietly infix                 ///
  str     year       1-9      ///
  str     regiona    10-10    ///
  str     divisiona  11-11    ///
  str     state      12-35    ///
  str     statea     36-37    ///
  str     county     38-94    ///
  str     countya    95-97    ///
  str     cousuba    98-102   ///
  str     placea     103-107  ///
  str     tracta     108-113  ///
  str     concita    114-118  ///
  str     aianhha    119-122  ///
  str     res_onlya  123-126  ///
  str     trusta     127-130  ///
  str     aitscea    131-133  ///
  str     anrca      134-138  ///
  str     cbsaa      139-143  ///
  str     csaa       144-146  ///
  str     metdiva    147-151  ///
  str     nectaa     152-156  ///
  str     cnectaa    157-159  ///
  str     nectadiva  160-164  ///
  str     uaa        165-169  ///
  str     cdcurra    170-171  ///
  str     sldua      172-174  ///
  str     sldla      175-177  ///
  str     submcda    178-182  ///
  str     sdelma     183-187  ///
  str     sdseca     188-192  ///
  str     sdunia     193-197  ///
  str     puma5a     198-202  ///
  str     bttra      203-208  ///
  str     name_e     209-408  ///
  double  jwue001    409-417  ///
  double  jwue002    418-426  ///
  double  jwue003    427-435  ///
  str     name_m     436-635  ///
  double  jwum001    636-644  ///
  double  jwum002    645-653  ///
  double  jwum003    654-662  ///
  using `"nhgis0050_ds177_20105_2010_county.dat"'


format jwue001   %9.0f
format jwue002   %9.0f
format jwue003   %9.0f
format jwum001   %9.0f
format jwum002   %9.0f
format jwum003   %9.0f

label var year      `"Data File Year"'
label var regiona   `"Region Code"'
label var divisiona `"Division Code"'
label var state     `"State Name"'
label var statea    `"State Code"'
label var county    `"County Name"'
label var countya   `"County Code"'
label var cousuba   `"County Subdivision Code"'
label var placea    `"Place Code"'
label var tracta    `"Census Tract Code"'
label var concita   `"Consolidated City Code"'
label var aianhha   `"American Indian Area/Alaska Native Area/Hawaiian Home Land Code"'
label var res_onlya `"American Indian Area/Alaska Native Area (Reservation or Statistical Entity Only)"'
label var trusta    `"American Indian Reservation with Trust Lands; trust lands only Code"'
label var aitscea   `"Tribal Subdivision/Remainder Code"'
label var anrca     `"Alaska Native Regional Corporation Code"'
label var cbsaa     `"Metropolitan Statistical Area/Micropolitan Statistical Area Code"'
label var csaa      `"Combined Statistical Area Code"'
label var metdiva   `"Metropolitan Division Code"'
label var nectaa    `"New England City and Town Area Code"'
label var cnectaa   `"Combined New England City and Town Area Code"'
label var nectadiva `"New England City and Town Area Division Code"'
label var uaa       `"Urban Area Code"'
label var cdcurra   `"Congressional District (111th Congress) Code"'
label var sldua     `"State Legislative District (Upper Chamber) Code"'
label var sldla     `"State Legislative District (Lower Chamber) Code"'
label var submcda   `"Subminor Civil Division Code"'
label var sdelma    `"School District (Elementary)/Remainder Code"'
label var sdseca    `"School District (Secondary)/Remainder Code"'
label var sdunia    `"School District (Unified)/Remainder Code"'
label var puma5a    `"Public Use Microdata Sample Area (PUMA) Code"'
label var bttra     `"Tribal Census Tract Code"'
label var name_e    `"Estimates: Area Name"'
label var jwue001   `"Estimates: Total"'
label var jwue002   `"Estimates: Native"'
label var jwue003   `"Estimates: Foreign-Born"'
label var name_m    `"Margins of error: Area Name"'
label var jwum001   `"Margins of error: Total"'
label var jwum002   `"Margins of error: Native"'
label var jwum003   `"Margins of error: Foreign-Born"'


